<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <script type="text/javascript">
        function Person(name,age,sex,fri){
            this.name = name;
            this.age= age;
            this.sex = sex;
            this.fri = fri;
            this.play = function (){
                alert("他是"+this.name+"我"+this.age+"岁，性别："+this.sex+"有一个"+this.fri);
            }
        }


        function person2(name){
            this.name = name;
            this.say = function (){
                alert(this.name+"：会说"+"i like you ,but just like you!");
            };
        };
        var man = new Person("小明",18,"男","男朋友");
        man.play();
        var man2 = new person2("男朋友");
        man2.say();








    </script>
</body>
</html>